package com.lineage.server.serverpackets;

import com.lineage.server.model.L1NpcTalkData;

public class S_NPCTalkActionTPUrl extends ServerBasePacket {
  private byte[] _byte;
  
  public S_NPCTalkActionTPUrl(L1NpcTalkData cha, Object[] prices, int objid) {
    this._byte = null;
    buildPacket(cha, prices, objid);
  }
  
  private void buildPacket(L1NpcTalkData npc, Object[] prices, int objid) {
    String htmlid = "";
    htmlid = npc.getTeleportURL();
    writeC(39);
    writeD(objid);
    writeS(htmlid);
    writeH(1);
    writeH(prices.length);
    int length = prices.length;
    int i = 0;
    while (i < length) {
      Object price = prices[i];
      writeS(String.valueOf(((Integer)price).intValue()));
      i++;
    } 
  }
  
  public byte[] getContent() {
    if (this._byte == null)
      this._byte = getBytes(); 
    return this._byte;
  }
  
  public String getType() {
    return getClass().getSimpleName();
  }
}
